import '@assets/main.css'

import {createApp} from 'vue'


import App from '@/App.vue'
import naive from 'naive-ui'
import {setupStore} from "@/stores";
import {setupDirectives} from '@/directive';
import router, {setupRouter} from "@/router/index.ts";

async function bootStart() {
    const app = createApp(App)
    //挂载ui组件库
    app.use(naive);
    // 挂载状态管理
    setupStore(app);
    //注册全局自定义指令，如：v-permission权限指令
    setupDirectives(app);
    // 挂载路由
    await setupRouter(app);
    // 路由准备就绪后挂载APP实例
    await router.isReady();

    app.mount('#app')
}

void bootStart();
